// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import 'lib-flexible/flexible'
Vue.config.productionTip = false
import "@/assets/scss/main.scss"
//minui的引入
import Mint from 'mint-ui';
import 'mint-ui/lib/style.css';
Vue.use(Mint);
//阿里巴巴矢量图标
import "@/assets/scss/iconfont.css"
//微信sdk
import wx from 'weixin-js-sdk'
/* eslint-disable no-new */
import "@/assets/scss/iconfont.css"
//vant-ui 框架
import Vant from 'vant';
import 'vant/lib/vant-css/index.css';
//图片预览组件，vant组件中的不可用，标签内使用preview属性
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
Vue.use(preview)
/*Vue.use(Vant);*/
/**
 * 生成二维码
 */
import VueQriously from 'vue-qriously'
Vue.use(VueQriously)
//引入vuex
import store from './store'
/***
 * 引入jquery
 */
// import $ from 'jquery';
/**
 * 路由拦截器，待更新
 */
// const whiteList = ['/mine','/home','/appointservice','/loading','/auth','/redirect','/register','/storedetail','/map','/storeprice','/active'];
// router.beforeEach((to, from, next) => {
//   //测试加入atoken
//   // localStorage.setItem('access-token','eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc0JpbmRQaG9uZSI6dHJ1ZSwibWVyY2hhbnRJZCI6IjEiLCJzdG9yZU1lbWJlcklkIjoiMTI4NyIsImV4cCI6MTUzMzcxNTU1NH0.T_CM6MRvaGG2NmzgDYYz9rwkRaNk2ToZWz22Dt1DW5o')
//   let tourl = decodeURIComponent(window.location.href);
//   let officialAccount = tourl.split("officialName=");
//   if(tourl.indexOf("officialName") > 0){
//     if(localStorage.officialName != undefined){
//       if(officialAccount[1] != localStorage.officialName){
//         console.log(whiteList.indexOf(to.path));
//         if(whiteList.indexOf(to.path) < 0){
//           localStorage.setItem("officialName",officialAccount[1]);
//           localStorage.setItem("toPath",to.fullPath);
//           window.location.href ="/auth";
//         }else{
//           localStorage.removeItem("access-token");
//         }
//       }
//     }else{
//       localStorage.setItem("officialName",officialAccount[1]);
//     }
//   }
//   document.title = to.name;
//   if(!localStorage.getItem("access-token")) {
//     if(whiteList.indexOf(to.path) < 0) { // 在免登录白名单，直接进入
//       if(to.fullPath != "/auth"){
//         localStorage.setItem('toPath',to.fullPath);
//       }
//       window.location.href = "/auth?reference=" + window.location.origin + '/loading';
//     }
//   }else{
//     if(localStorage.isBind === "false"){
//       if(whiteList.indexOf(to.path) < 0) { // 在免登录白名单，直接进入
//         if(to.fullPath != "/auth"){
//           localStorage.setItem('toPath',from.fullPath);
//         }
//         next({path:'/register'})
//       }
//     }
//   }
//   next()
// });
new Vue({
  el: '#app',
  router,
  store,
  components: {
    App
  },
  template: '<App/>'
})
